//
//  MainzhuyaoView.m
//  OpenYooxi_IOS
//
//  Created by YeahYes on 15/3/17.
//  Copyright (c) 2015年 com.ivyvi.ee. All rights reserved.
//

#import "MainzhuyaoView.h"
#import "ShangpinxiangqingView.h"

@implementation MainzhuyaoView{
    ShangpinxiangqingView *xiangqing;
}


- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if(self){
        self.userInteractionEnabled = YES;
        [self _createView];
        
    }
    return self;
    
}

- (void)setTuanViewArray:(NSArray *)tuanViewArray{
    if(_tuanViewArray != tuanViewArray){
        _tuanViewArray = tuanViewArray;
        
        NSInteger a =0;
        NSInteger b =0;
        if(tuanViewArray.count != 0){
            for(NSInteger i =1;i<=tuanViewArray.count;i++){
                
                NSInteger shuzi = i/4;
                
                if(i == 4){
                    shuzi=0;
                }else if (i == 8){
                    shuzi =1;
                }if(i == 5){
                    a = b;
                }
                
                xiangqing = [[ShangpinxiangqingView alloc] initWithFrame:CGRectMake((kScreenWidth/4)*a,shuzi*110,kScreenWidth/4 ,110)];
                xiangqing.userInteractionEnabled = YES;
                xiangqing.layer.borderColor = UIColorFromRGB(0xE5E5E5).CGColor;
                xiangqing.layer.borderWidth = 0.5;
                [self addSubview:xiangqing];
                
                a++;
            }
        }
    }
    
}


- (void)_createView {
    
}


@end
